// amis上的配置
export const questionNatureConfig =
{
  "type": "page",
  "title": "题目性质管理",
  "id": "u:b2557d3ef446",
  "toolbar": [
  ],
  "asideResizor": false,
  "pullRefresh": {
    "disabled": true
  },
  "regions": [
    "body",
    "toolbar",
    "header"
  ],
  "body": [
    {
      "type": "crud",
      "syncLocation": false,
      "api": {
        "method": "get",
        "url": "http://localhost:8080/questionnature/listPage",
        "messages": {
        },
        "requestAdaptor": "",
        "adaptor": "",
        "dataType": "form-data"
      },
      "autoGenerateFilter":true,
      "headerToolbar": [
            {
              "type": "columns-toggler",
              "align": "right",
              "draggable": true,
              "icon": "fas fa-cog",
              "overlay": true,
              "footerBtnSize": "sm"
            }
          ],
      "columns": [
        {
          "name": "id",
          "label": "ID",
          "type": "text",
          "id": "u:9e3d4aae386b",
          "searchable": {
                    "type": "input-text",
                    "name": "id",
                    "label": "id",
                    "placeholder": "输入题目id"
                  }
        },
        {
          "name": "answer",
          "label": "答案",
          "type": "text",
          "id": "u:23e538b33872",

                placeholder: "-",
                popOver: {
                  type: "panel",
                  title: "答案详情",
                  body: [
                    {
                      type: "tpl",
                      tpl: "${answer}",
                      wrapperComponent: "",
                      inline: false,
                      id: "u:8241c6dd0e5c",
                      hiddenOn: "${STARTSWITH(answer, 'http')}",
                    },
                  ],
                  id: "u:f3242260fd48",
                  actions: [
                    {
                      type: "flex",
                      id: "u:b76e50629a7e",
                      className: "p-1",
                      items: [
                        {
                          type: "container",
                          body: [
                            {
                              type: "image",
                              id: "u:a588c87c8810",
                              width: 100,
                              height: 242,
                              enlargeAble: true,
                              imageMode: "original",
                              src: "",
                              hiddenOn: "${!STARTSWITH(answer, 'http')}",
                              thumbRatio: "4:3",
                              className: "",
                              thumbClassName: "",
                              imageClassName: "image-amis",
                            },
                          ],
                          size: "xs",
                          style: {
                            position: "static",
                            display: "block",
                            flex: "1 1 auto",
                            flexGrow: 1,
                            flexBasis: "auto",
                          },
                          wrapperBody: false,
                          isFixedHeight: false,
                          isFixedWidth: false,
                          id: "u:1bbc9b245ce4",
                        },
                      ],
                      style: {
                        position: "relative",
                        inset: "auto",
                        flexWrap: "nowrap",
                        width: "100%",
                        overflowX: "auto",
                        margin: "0",
                        height: "100%",
                        overflowY: "auto",
                      },
                      isFixedHeight: true,
                      isFixedWidth: true,
                    },
                  ],
                  affixFooter: false,
                  hidden: false,
                  mode: "dialog",
                },

        },
        {
          "type": "text",
          "label": "知识点",
          "id": "u:50d218b0d903",
          "name": "knowledge",
          "searchable": {
                    "type": "select",
                    "name": "knowledge",
                    "label": "知识点",
                    "placeholder": "选择题目知识点",
                    "options": [
                      {
                        "label": "java编程语言",
                        "value": "java编程语言"
                      },
                      {
                        "label": "mysql数据库",
                        "value": "mysql数据库"
                      },
                      {
                        "label": "python编程",
                        "value": "python编程"
                      }
                    ]
                  }
        },
        {
          "type": "text",
          "label": "难易度",
          "id": "u:6590ed14ff59",
          "name": "difficulty"
        },
        {
          "type": "text",
          "label": "所属章节",
          "id": "u:39b20b05e68f",
          "name": "chapter",
          "searchable": {
                    "type": "select",
                    "name": "chapter",
                    "label": "所属章节",
                    "placeholder": "选择题目章节",
                    "options": [
                      {
                        "label": "基础语法",
                        "value": "基础语法"
                      },
                      {
                        "label": "连接语法",
                        "value": "连接语法"
                      },
                      {
                        "label": "嵌套语法",
                        "value": "嵌套语法"
                      }
                    ]
                  }
        },
        {
          "type": "text",
          "label": "易错点",
          "id": "u:8075dd1c0c03",
          "name": "errorProne"
        },
        {
          "type": "text",
          "label": "错误率",
          "id": "u:ef174152f36c",
          "name": "errorRate"
        },
        {
          "type": "operation",
          "label": "操作",
          "buttons": [
            {
              "type": "button",
              "label": "删除",
              "actionType": "ajax",
              "level": "link",
              "className": "text-danger",
              "confirmText": "确定要删除？",
              "api": {
                "method": "delete",
                "url": "http://localhost:8080/questionnature/${id}",
                "messages": {
                },
                "requestAdaptor": "",
                "adaptor": ""
              },
              "id": "u:801be36f589a"
            },
            {
              "label": "编辑",
              "type": "button",
              "actionType": "dialog",
              "level": "link",
              "dialog": {
                "title": "编辑题目性质",
                "body": {
                  "type": "form",
                  "initApi":"http://localhost:8080/questionnature/type/${id}",
                  "api":{
                    "method":"put",
                    "url":"http://localhost:8080/questionnature"
                  },
                  "body": [
                    {
                      "type":"hidden",
                      "name": "id",
                    },
                    {
                      "name": "id",
                      "label": "ID",
                      "id": "u:9e3d4aae386b",
                      "readOnly": true,
                      "static": true,
                      "type": "input-text"
                    },
                    {
                      "label": "类型",
                      "id": "u:50d218b0d903",
                      "name": "type",
                      "type": "input-text",
                      "readOnly": true,
                      "static": true,
                      "initApi":"http://localhost:8080/questionnature/type/${id}",
                      "body":"${type}"
                    },
                              {
                                type: "input-text",
                                name: "answer",
                                label: "答案内容",
                                id: "u:1d53cfdba203",
                                clearValueOnHidden: true,
                                hiddenOn: "this.type == '主观题（贴图）'",
                              },
                              {
                                type: "input-image",
                                name: "answer",
                                label: "答案上传",
                                id: "u:f2816f575828",
                                autoUpload: false,
                                proxy: false,
                                uploadType: "fileReceptor",
                                imageClassName: "r w-full",
                                accept: ".jpeg, .jpg, .png, .gif",
                                multiple: false,
                                hideUploadButton: false,
                                hiddenOn: "this.type == '选择题' || this.type == '填空题'",
                                bos: "default",
                                clearValueOnHidden: true,
                                receiver: {
                                  url: "http://localhost:8080/question/upload",
                                  method: "post",
                                  requestAdaptor: "",
                                  adaptor: "",
                                  messages: {},
                                  dataType: "form-data",
                                },
                              },
                    {
                      "label": "知识点",
                      "id": "u:50d218b0d903",
                      "name": "knowledge",
                      "type": "input-text"
                    },
                    {
                      "label": "难易度",
                      "id": "u:6590ed14ff59",
                      "name": "difficulty",
                      "type": "input-text"
                    },
                    {
                      "label": "所属章节",
                      "id": "u:39b20b05e68f",
                      "name": "chapter",
                      "type": "input-text"
                    },
                    {
                      "label": "易错点",
                      "id": "u:8075dd1c0c03",
                      "name": "errorProne",
                      "type": "input-text"
                    },
                    {
                      "label": "错误率",
                      "id": "u:ef174152f36c",
                      "name": "errorRate",
                      "type": "input-text"
                    }
                  ]
                }
              },
              "id": "u:ccad1c1de367"
            }
          ],
          "id": "u:7e11aef8d1e3"
        }
      ],
      "bulkActions": [
      ],
      "itemActions": [
      ],
      "features": [
        "create",
        "filter",
        "delete",
        "update"
      ],
      "filterColumnCount": 3,
      "headerToolbar": [
        {
          "label": "新增",
          "type": "button",
          "actionType": "dialog",
          "level": "primary",
          "dialog": {
            "title": "新增题目性质",
            "body": [
              {
                "type": "form",
                "api": {
                  "method": "post",
                  "url": "http://localhost:8080/questionnature",
                  "messages": {
                  },
                  "requestAdaptor": "",
                  "adaptor": "",
                  "dataType": "jason",
                  "data":{
                    "id":"$id",
                    "answer":"$answer",
                    "knowledge":"$knowledge",
                    "difficulty":"$difficulty",
                    "chapter":"$chapter",
                    "errorProne":"$errorProne",
                    "errorRate":"$errorRate"
                  }
                },
                "body": [
                  {
                    "type": "input-text",
                    "name": "id",
                    "label": "ID",
                    "required": true,
                    "id": "u:ecfe42049ef4"
                  },
                {
                   type: "select",
                   name: "type",
                   label: "类型",
                   id: "u:ff6bad9ad4b9",
                                options: [
                                  {
                                    label: "选择题",
                                    value: "select",
                                  },
                                  {
                                    label: "填空题",
                                    value: "blank",
                                  },
                                  {
                                    label: "主观题（贴图）",
                                    value: "picture",
                                  },
                                ],
                                multiple: false,
                                value: "picture",
                                required: true,
                              },
                              {
                                type: "input-text",
                                name: "answer",
                                label: "答案内容",
                                id: "u:1d53cfdba203",
                                required: true,
                                clearValueOnHidden: true,
                                hiddenOn: "this.type === 'picture'",
                              },
                              {
                                type: "input-image",
                                name: "answer",
                                label: "答案上传",
                                id: "u:f2816f575828",
                                autoUpload: false,
                                proxy: false,
                                uploadType: "fileReceptor",
                                imageClassName: "r w-full",
                                accept: ".jpeg, .jpg, .png, .gif",
                                multiple: false,
                                hideUploadButton: false,
                                hiddenOn: "this.type != 'picture'",
                                bos: "default",
                                clearValueOnHidden: true,
                                required: true,
                                receiver: {
                                  url: "http://localhost:8080/question/upload",
                                  method: "post",
                                  requestAdaptor: "",
                                  adaptor: "",
                                  messages: {},
                                  dataType: "form-data",
                                },
                              },
                  {
                    "type": "input-text",
                    "name": "knowledge",
                    "label": "知识点",
                    "required": true,
                    "id": "u:9c334e75a68a"
                  },
                  {
                    "type": "input-text",
                    "name": "difficulty",
                    "label": "难易度",
                    "required": true,
                    "id": "u:40dd45ca6e71"
                  },
                  {
                    "type": "input-text",
                    "name": "chapter",
                    "label": "所属章节",
                    "required": true,
                    "id": "u:30c5f28ade82"
                  },
                  {
                    "type": "input-text",
                    "name": "errorProne",
                    "required": true,
                    "label": "易错点",
                    "id": "u:d8b268d86f6f"
                  },
                ],
                "id": "u:a3ceddca77c2"
              }
            ],
            "type": "dialog",
            "id": "u:eee1ff9e11a6"
          },
          "id": "u:06f255567da0"
        },
        "bulkActions"
      ],
      "id": "u:3e550fe70c7e",
      "perPageAvailable": [
        10
      ],
      "messages": {
      }
    }
  ]
}